package com.webside.trailerManagement.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.base.baseservice.impl.AbstractService;
import com.webside.series.mapper.SeriesMapper;
import com.webside.series.model.SeriesEntity;
import com.webside.trailerManagement.mapper.VideoFromWebMapper;
import com.webside.trailerManagement.model.VideoFromWebEntity;
import com.webside.trailerManagement.service.VideoFromWebService;
import com.webside.util.PageUtil;

@Service("videoFormWebService")
public class VideoFromWebServiceImpl extends AbstractService<VideoFromWebEntity, Long> implements VideoFromWebService {

	@Autowired
	private VideoFromWebMapper videoFromWebMapper;

	// 这句必须要加上。不然会报空指针异常，因为在实际调用的时候不是BaseMapper调用，而是具体的mapper，这里为userMapper
	@Autowired
	public void setBaseMapper() {
		super.setBaseMapper(videoFromWebMapper);
	}

	@Override
	public int updateOnline(List<Long> roleIds) {
		// TODO Auto-generated method stub
		return videoFromWebMapper.updateOnline(roleIds);
	}

	@Override
	public int updateOffline(List<Long> roleIds) {
		// TODO Auto-generated method stub
		return videoFromWebMapper.updateOffline(roleIds);
	}

	@Override
	public int bindVideo(int id, List<Integer> ids) {
		// TODO Auto-generated method stub
		return videoFromWebMapper.bindVideo(id,ids);
	}
	@Override
	public int unbindVideo(int id) {
		// TODO Auto-generated method stub
		return videoFromWebMapper.unbindVideo(id);
	}
	@Override
	public List<VideoFromWebEntity> findListByBindid(PageUtil pageUtil, int bindid,String sort){
		 sort = "";
		return videoFromWebMapper.selectByBindid(pageUtil,bindid,sort);
	}
}
